﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeLine2d : OdGeLinearEnt2d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeLine2d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeLine2d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeLine2d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeLine2d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeLine2d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeLine2d() : this(GlobalsPINVOKE.new_OdGeLine2d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLine2d(OdGeLine2d source) : this(GlobalsPINVOKE.new_OdGeLine2d__SWIG_1(OdGeLine2d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLine2d(OdGePoint2d point, OdGeVector2d vect) : this(GlobalsPINVOKE.new_OdGeLine2d__SWIG_2(OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeLine2d(OdGePoint2d point1, OdGePoint2d point2) : this(GlobalsPINVOKE.new_OdGeLine2d__SWIG_3(OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public static OdGeLine2d kXAxis
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGeLine2d_kXAxis_get();
				OdGeLine2d result = (intPtr == IntPtr.Zero) ? null : new OdGeLine2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public static OdGeLine2d kYAxis
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGeLine2d_kYAxis_get();
				OdGeLine2d result = (intPtr == IntPtr.Zero) ? null : new OdGeLine2d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public OdGeLine2d set(OdGePoint2d point, OdGeVector2d vect)
		{
			OdGeLine2d result = new OdGeLine2d(GlobalsPINVOKE.OdGeLine2d_set__SWIG_0(this.swigCPtr, OdGePoint2d.getCPtr(point), OdGeVector2d.getCPtr(vect).Handle), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLine2d set(OdGePoint2d point1, OdGePoint2d point2)
		{
			OdGeLine2d result = new OdGeLine2d(GlobalsPINVOKE.OdGeLine2d_set__SWIG_1(this.swigCPtr, OdGePoint2d.getCPtr(point1), OdGePoint2d.getCPtr(point2)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeLine2d Assign(OdGeLine2d line)
		{
			OdGeLine2d result = new OdGeLine2d(GlobalsPINVOKE.OdGeLine2d_Assign(this.swigCPtr, OdGeLine2d.getCPtr(line)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
